<template>
  <div>
    <el-tooltip :content="isFullscreen?'退出全屏':'全屏'" effect="dark" placement="bottom">
      <svg-icon :icon-class="isFullscreen?'exit-fullscreen':'fullscreen'" @click="click" />
    </el-tooltip>
  </div>
</template>

<script>
import screenfull from 'screenfull';

export default {
  name: 'Screenfull',
  data() {
    return {
      isFullscreen: false,
    };
  },
  methods: {
    click() {
      screenfull.toggle();
      this.isFullscreen = !this.isFullscreen;
    },
  },
};
</script>

<style scoped>
</style>
